﻿using NUnit.Framework;

namespace InvoiceInvoker.Logic.Tests
{
	[TestFixture]
	public class ValidatorTests
	{
		[Test, Sequential]
		public void ValidatesCorrectNip([Values("1234563218", "1060000062")] string nip)
		{
			Assert.AreEqual(true, Validator.ValidateNip(nip));
		}

		[Test, Sequential]
		public void ValidatesIncorrectNip([Values("1234563219", "123456", "123error", "error")] string nip)
		{
			Assert.AreEqual(false, Validator.ValidateNip(nip));
		}

		[Test]
		public void ValidatesCorrect9DigitsRegon()
		{
			bool result = Validator.ValidateRegon("123456785");
			Assert.AreEqual(true, result);
		}

		[Test]
		public void ValidatesCorrect14DigitsRegon()
		{
			bool result = Validator.ValidateRegon("12345678512347");
			Assert.AreEqual(true, result);
		}

		[Test, Sequential]
		public void ValidatesIncorrectRegon([Values("123456786", "12345678512348", "123error", "error")] string regon)
		{
			Assert.AreEqual(false, Validator.ValidateRegon(regon));
		}
	}
}
